/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Sample UML2 to C++ generation
 *
 * Copyright (c) 2013 Alexander Diemand
 * All rights reserved.
 *
 * Author:     Alexander Diemand
 * Address:    Outerspace
 * Project:    Sample UML2 to C++ generation
 *
 * UML2 to C++ 
 * In easy steps from UML2 modeling to C++ coding.
 * What already works:
 * i)   generation of source and headers for enums and classes
 * ii)  the latter are: datatypes, interfaces and standard classes
 * iii) inherited static operations
 * iv)  isLeaf -> final, isReadOnly/isQuery -> const
 * What needs some work:
 * i)   templates are not yet supported
 * ii)  testing testing testing
 *
 * Repository: tbd
 * Generated:  2013-03-23 16:59:02
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#include "dataModel/Controller.hpp"

// Start of user code for includes
#include <memory>
#include <string>
// End of user code

/**
 * @generated with Eclipse/Acceleo
 *  
 */

namespace dataModel
{

// Start of user code implementation of constructors/destructor


// CTOR
Controller::Controller()
	
{ }

// DTOR
Controller::~Controller()
{ }

// End of user code

// * * * * *  O P E R A T I O N S  * * * * *
/**
 * The method addData.
 * @param d
 * 
 * @generated
 */
void Controller::addData(const DataContainer & d)
{
	// Start of user code for the body of Controller::addData_DataContainer
	// TODO should be implemented

        data.push_back(d);

	// End of user code
}

/**
 * The method findDataByName.
 * @param n
 * @return DataContainer
 * 
 * @generated
 */
DataContainer Controller::findDataByName(const std::string & n)
{
	// Start of user code for the body of Controller::findDataByName_String
	// TODO should be implemented
        std::vector<DataContainer>::iterator it;
        for (it=data.begin(); it!=data.end(); ++it)
        {
                if ((*it).getName() == n)
                        return *it;
        }
        return DataContainer("","","",0);
	// End of user code
}



} // namespace dataModel
